<?php

namespace LEA\StageBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use LEA\StageBundle\Utility\Utility;

class ListeTuteur extends AbstractType
{
  public function buildForm(FormBuilderInterface $builder, array $options)
  {

  	$conn = $options['conn'];
	$session = $options[1];

  	$utils = new Utility() ;
  	$queries = new Queries($conn);
	$listTuteurs=$queries->doQueryListTuteursParAnnee(false, $session);

	$array = array();
	foreach($listTuteurs as $value){
		array_push($array, $value) ;
	}

    $builder->add('tuteur', 'choice', array(
    'label' => 'Choisissez le tuteur :',
    'choices' => $array
	));
   }


 public function getName()
  {
    return 'lea_stagebundle_listetuteur';
  }
}